<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: frequency_scrambling.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">frequency_scrambling.h</div>  </div>
</div>
<div class="contents">
<a href="frequency__scrambling_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00007"></a>00007 <span class="preprocessor">#ifndef FREQUENCY_SCRAMBLING_H_</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define FREQUENCY_SCRAMBLING_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="crypto__engine_8h.html">crypto_engine.h</a>&quot;</span>
<a name="l00011"></a>00011 
<a name="l00023"></a><a class="code" href="classCFrequencyScrambling.html">00023</a> <span class="keyword">class </span><a class="code" href="classCFrequencyScrambling.html" title="Encrypts and decrypts audio samples using the Frequency Permutation algorithm.">CFrequencyScrambling</a>: <span class="keyword">public</span> <a class="code" href="classCCryptoEngine.html" title="Implementation of a crypto engine.">CCryptoEngine</a> {
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">public</span>:
<a name="l00028"></a>00028 
<a name="l00029"></a>00029         <a class="code" href="classCFrequencyScrambling.html#adaee180f0273a4faf89fc1db28506bb0">CFrequencyScrambling</a>(<a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> ioStreamInfo);
<a name="l00030"></a>00030 
<a name="l00031"></a>00031         <span class="keyword">virtual</span> <a class="code" href="classCFrequencyScrambling.html#aaa31b315df0f4bc566857f299c30399a">~CFrequencyScrambling</a>();
<a name="l00032"></a>00032 
<a name="l00044"></a>00044         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a7cd3434ecb1b1a4a3033c84f2ca0968e">encrypt</a>(<span class="keywordtype">double</span> *pData, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount);
<a name="l00045"></a>00045 
<a name="l00056"></a>00056         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a833eb843ff0de97a801f7f12a5807f60">decrypt</a>(<span class="keywordtype">double</span> *pData, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount);
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="keyword">protected</span>:
<a name="l00068"></a>00068         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a5b7467e7a2d40a1643186b7066c1fdb9">changeSettings</a>();
<a name="l00069"></a>00069 
<a name="l00080"></a>00080         <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#ad117dc8d000544f06161c83d39e96aae">getSamplesNeeded</a>();
<a name="l00081"></a>00081 
<a name="l00096"></a>00096         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#adad5aa7d3855c27ae5e6de65de00bdcc">getPermutationVector</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *pVector, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount,
<a name="l00097"></a>00097                                <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pAlgorithm, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pMin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pMax);
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 <span class="keyword">private</span>:
<a name="l00110"></a>00110         <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a3bae8018b5168d1fb97dea442dae7edd">dencrypt</a>(<span class="keywordtype">double</span> * pData, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pCount, <span class="keywordtype">bool</span> bEncrypt);
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="classCFrequencyScrambling.html#a47c6e1f6437bce45fff18bda1d9eb652">00112</a>         <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="classCFrequencyScrambling.html#a47c6e1f6437bce45fff18bda1d9eb652">sIniSectionName</a>;
<a name="l00113"></a><a class="code" href="classCFrequencyScrambling.html#a4fe5c4e10a1a091aff8106c57d41a63b">00113</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a4fe5c4e10a1a091aff8106c57d41a63b" title="Permutation has no effect. Only for testing.">sPERMUTATION_NULL</a> = 0;   
<a name="l00114"></a><a class="code" href="classCFrequencyScrambling.html#a2b2e7e8452fbfedd392254cb763da2bc">00114</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a2b2e7e8452fbfedd392254cb763da2bc" title="Frequencies become inversed.">sPERMUTATION_REVERSE</a> = 1;   
<a name="l00115"></a><a class="code" href="classCFrequencyScrambling.html#a646bcfc2cf645d087ab27b3b8e591017">00115</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a646bcfc2cf645d087ab27b3b8e591017" title="AES is used for the permutation.">sPERMUTATION_SWAPPING_AES</a> = 2;      
<a name="l00116"></a><a class="code" href="classCFrequencyScrambling.html#a0c0c9486bcc82cf31240e81b9ca1bfc6">00116</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a0c0c9486bcc82cf31240e81b9ca1bfc6" title="Like SWAPPING_AES but it is done in blocks.">sPERMUTATION_SWAPPING_AES_BLOCKED</a> = 3;   
<a name="l00117"></a><a class="code" href="classCFrequencyScrambling.html#ad35e7c68a57aee36d2ae24aac6f8524d">00117</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#ad35e7c68a57aee36d2ae24aac6f8524d" title="FFT will be used, for future use.">sENCRYPTION_MODE_FFT</a>=1;   
<a name="l00118"></a><a class="code" href="classCFrequencyScrambling.html#aaff3591a862dd61ba4334280bbea9892">00118</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#aaff3591a862dd61ba4334280bbea9892" title="The used permutatino mode like SWAPPING_AES.">mPermutationMode</a>;   
<a name="l00119"></a><a class="code" href="classCFrequencyScrambling.html#a370eb8dbdeee900d84ac0242b2446dc8">00119</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#a370eb8dbdeee900d84ac0242b2446dc8" title="The used encryption mode like FFT.">mEncryptionMode</a>;   
<a name="l00120"></a><a class="code" href="classCFrequencyScrambling.html#ab19eb033f2a4f75994afa0e4a4c9ae0e">00120</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCFrequencyScrambling.html#ab19eb033f2a4f75994afa0e4a4c9ae0e" title="Defines how many Samples are needed at en-/decryption.">mSamplesNeeded</a>;   
<a name="l00121"></a>00121 };
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="preprocessor">#endif </span><span class="comment">/* FREQUENCY_SCRAMBLING_H_ */</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:39 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
